#pragma once

#include "sys/IInterface.h"

#include "FormID.h"
#include "Formtypes.h"
#include "messenging/event/args/SystemEventArgs.h"

delegate Delegate<bool(IObject* /*sender*/,SystemEventArgs* /*e*/)> ClickEventHandler;
delegate Delegate<bool(IObject* /*sender*/,SystemEventArgs* /*e*/)> UpdateUIEventHandler;
delegate Delegate<void(IObject* /*sender*/,vresult /*e*/)> ErrorEventHandler;

interface IControl : public IInterface
{
	DEFINE_IID(IID_Control)

	event_declare(ClickEventHandler,Click);
	event_declare(UpdateUIEventHandler,UpdateUI);
	event_declare(ErrorEventHandler,Error);

	virtual void SetCaption(const String& value) = 0;
	virtual void SetDescription(const String& value) = 0;
	virtual void SetTip(const String& value) = 0;
	virtual void SetHotKey(const Hotkey& value) = 0;
	virtual void SetICon(vSysICon value) = 0;
	virtual void SetBeginGroup(bool value=true) = 0;
	virtual void SetEnabled(bool value=true) = 0;
	virtual void SetVisible(bool visible=true) = 0;

	virtual const String& GetCaption() const = 0;
	virtual const String& GetDescription() const = 0;
	virtual const String& GetTip() const = 0;
	virtual const Hotkey& GetHotKey() const = 0;
	virtual vSysICon GetICon() const = 0;
	virtual bool GetBeginGroup() const = 0;
	virtual bool IsEnabled() const = 0;
	virtual bool IsVisible() const = 0;

	virtual uint32 GetCommandID() const = 0;
	virtual void SetCommandID(uint32 value) = 0;
};

